#include <iostream>
#include <fstream>
using namespace std;
ofstream out("static.out");
class obj
{
    char c;

public:
    obj(char cc) : c(cc)//Initializing
    {
        //c = cc;
        out << ":obj::obj() for " << c << endl;
        cout << ":obj::obj() for " << c << endl;
    }
    ~obj()
    {
        out << ":obj::obj() for " << c << endl;
        cout << ":obj::obj() for " << c << endl;
    }
};
//Constructor & destructor always called
obj a('a'); //Global (static storage)
void f()
{
    static obj b('b');
}
void g()
{
    static obj c('c');
}
int main()
{
    out << "Inside main()" << endl;
    cout << "Inside main()" << endl;
    f();
    out << "Outside main()" << endl;
    cout << "Outside main()" << endl;
}